package com.xx.sg.controller;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.xx.sg.schedule.SatelliteAlarmTask;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hh")
@Tag(name = "浩海卫星报警", description = "浩海卫星报警")
public class SatelliteAlarmController {

    @GetMapping("/alarm")
    @Operation(summary = "报警信息查询", description = "报警信息查询")
    public JSONArray getSatelliteAlarm() {
        return SatelliteAlarmTask.SatelliteAlarmJson;
    }

    @GetMapping("/alarmTest")
    @Operation(summary = "报警信息查询测试", description = "报警信息查询测试")
    public JSONArray getSatelliteAlarmTest() {
        String testStr = "[\n" +
                "  {\n" +
                "    \"Id\": \"20200518104049332837975ce054d16\",\n" +
                "    \"Longitude\": 100.66999679999999,\n" +
                "    \"Latitude\": 23.344996799999997,\n" +
                "    \"ObservationFrequency\": 93,\n" +
                "    \"ObservationDateTime\": \"2020-05-18T10:20:00\",\n" +
                "    \"Strength\": 0,\n" +
                "    \"StrengthLevel\": 0,\n" +
                "    \"Woodland\": 1,\n" +
                "    \"Grassland\": 0,\n" +
                "    \"Farmland\": 0,\n" +
                "    \"Otherland\": 0,\n" +
                "    \"Area\": 0.186,\n" +
                "    \"Credibility\": 0.85,\n" +
                "    \"PixelArea\": 19.53,\n" +
                "    \"PixelNumber\": 19,\n" +
                "    \"Country\": \"中国\",\n" +
                "    \"CountryCode\": \"0\",\n" +
                "    \"Province\": \"云南省\",\n" +
                "    \"ProvinceCode\": \"530000\",\n" +
                "    \"City\": \"普洱市\",\n" +
                "    \"CityCode\": \"530800\",\n" +
                "    \"County\": \"景谷傣族彝族自治县\",\n" +
                "    \"CountyCode\": \"530824\",\n" +
                "    \"FormattedAddress\": \"云南省普洱市景谷傣族彝族自治县益智乡新田\",\n" +
                "    \"VisibleLightImageAddress\": \"/SatelliteData/H8-FIR/china/2020-05-18/Fire_Result/HN/HS_H08_2020-05-18_1020__HN_321_fp.jpg\",\n" +
                "    \"IRImageAddress\": \"/SatelliteData/H8-FIR/china/2020-05-18/Fire_Result/HN/HS_H08_2020-05-18_1020__HN_T3.72um_T.jpg\",\n" +
                "    \"Satellite\": \"Himawari-8\",\n" +
                "    \"PutStorageTime\": \"2020-05-18T10:40:49.837\",\n" +
                "    \"DataSourceFile\": \"1802879\",\n" +
                "    \"FireNo\": \"YN5308242005172340001\",\n" +
                "    \"DistrictNum\": \"26\"\n" +
                "  }\n" +
                "]\n";
        return JSON.parseArray(testStr);
    }
}
